<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>利用call函数继承父类</title>
</head>
<body>
  <script>
    function father(name,age) {
      this.name = name;
      this.age = age;
    }
    function Son(name,age) {
      /* 调用父函数 要传入自己的this */
      father.call(this,name,age);
    }
    var son = new Son('cty',18);
    console.log(son);
  </script>
</body>
</html>